
#ifndef __XB_CPU_EXCEPTION_H__
#define __XB_CPU_EXCEPTION_H__

/* ------------------------------------------------------------------------- */

#define EX_DE		0		/* divide error */
#define EX_DB		1		/* debug */
#define EX_BP		3		/* breakpoint */
#define EX_OF		4		/* overflow */
#define EX_BR		5		/* bound range exceeded */
#define EX_UD		6		/* invalid opcode (undefined opcode) */
#define EX_NM		7		/* device not available (no math coprocessor) */
#define EX_TS		10		/* invalid TSS */
#define EX_NP		11		/* segment not present */
#define EX_SS		12		/* stack-segment fault */
#define EX_GP		13		/* general protection */
#define EX_PF		14		/* page fault */
#define EX_MF		16		/* floating-point error (math fault) */
#define EX_AC		17		/* alignment check */
#define EX_MC		18		/* machine check */
#define EX_XF		19		/* streaming SIMD extension */

#define raise_exception(v)	raise_exception_with_error((v), 0)

/* ------------------------------------------------------------------------- */

capi void fastcall reset_exception(void);
capi void fastcall raise_exception_with_error(uint8 vector_no, uint32 error_code);

/* ------------------------------------------------------------------------- */

#endif
